All Questions
6 questions
0votes
3answers
662views
Java Library - How to do Pure Dependency Injection When State is a Factor?
To set the stage, I am trying to do pure dependency injection for a Java Library I am creating to make it more testable. As it is a library, I want to do pure dependency injection without creating a ...
1vote
2answers
473views
Chain of responsibility or simple dependency injection for Querying API
I am working on refactoring a project code that is wired up in a tangled way. It was started with decent dependency injection and over time with all custom requirements it looks it got tangled up. ...
-1votes
1answer
800views
IOC principle - Servlet container implementation
IOC principle can be implemented, using either: Dependency Injection Service locator pattern This article also supports these two approaches for implementing IOC principle. Spring IOC container is ...
27votes
4answers
10kviews
Legitimate "real work" in a constructor?
I am working on a design, but keep hitting a roadblock. I have a particular class (ModelDef) that is essentially the owner of a complex node tree built by parsing an XML schema (think DOM). I want to ...
5votes
2answers
1kviews
How to decouple simple factory and default implementation?
I have a simple factory class (FileResources) with static factory methods providing a default implementation (DefaultFileResource). public final class FileResources { private FileResources() {} ...
11votes
4answers
19kviews
How to use Dependency Injection in conjunction with the Factory pattern
Consider a module that is responsible for parsing files of any given type. I am thinking of using the strategy pattern to tackle this problem as I have already explained over here. Please refer to the ...